"""
N个人站成一圈。从起点开始传球，可以传左也可以传右
问恰好M次以后又回到起点的方案总数
令Dij表示i次传球到j的方案总数
Dij = D[i-1][j-1] + D[i-1][j+1]
"""
N, M = [int(i) for i in input().split()]
D = [[0 for i in range(N)] for j in range(M + 1)]
D[0][0] = 1

for i in range(1, M + 1):
    for j in range(N):
        D[i][j] = D[i - 1][(j + 1) % N] + D[i - 1][(j + N - 1) % N]
print(D[M][0])